Skip to content

Add optional GameSir G7 Pro 8K battery helper - #2206

Open
derekagraham78 wants to merge 1 commit into
flightlessmango:masterfrom
derekagraham78:fix/gamesir-g7-pro-8k-battery
Open

derekagraham78 wants to merge 1 commit into
flightlessmango:masterfrom
derekagraham78:fix/gamesir-g7-pro-8k-battery

Conversation

@derekagraham78

Copy link
Copy Markdown

The G7 Pro 8K PC receiver in XInput mode does not expose a battery through sysfs, so device_battery=gamepad has no reading. This adds an optional Python helper that reads the GameSir vendor report and supplies the percentage through MangoHud's existing exec option.

The helper runs separately from the overlay. It sends the temporary 0x0f,0xf2 reporting heartbeat and reads the battery from byte 36 of report 0x12. It does not require Deadband, detach the kernel driver, or change saved controller settings. This keeps USB reads/writes outside MangoHud, as discussed in #2199.

Includes setup instructions, an example user service, cached status with stale-reading detection, and tests. Support is limited to the tested 3537:10c6 G7 Pro 8K receiver; this does not claim support for every GameSir model or fix PS4-mode firmware reporting. The helper is opt-in and is not automatically installed.

Validation:

  • 11 Python unit tests passed, including disconnect/reconnect handling, permission failures, invalid reports, and stale cache detection.
  • Meson setup completed and meson test -C build --no-rebuild 'gamesir battery helper' passed.
  • Tested on the actual G7 Pro 8K receiver on CachyOS: --once returned 100%; the background reader subsequently reported 99%, refreshed the cache, and published Disconnected on SIGTERM. The existing reader service was restored after testing.
  • Charging flag and a full discharge cycle have not been hardware-validated.

Protocol reference: https://github.com/broroeror/gamesir-linux-tools

Refs #2199.

@flightlessmango

Copy link
Copy Markdown
Owner

Thanks for the PR. This is a standalone Python utility, and it already works with mangohud through exec. I don’t see a reason to ship it in mangohud. It makes sense as its own project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants